package com.superpeer.baseproject.activity;

import com.superpeer.baseproject.api.Api;
import com.superpeer.baseproject.baserx.RxSchedulers;
import com.superpeer.baseproject.bean.BaseBeanResult;

import rx.Observable;
import rx.functions.Func1;

public class MainModel implements MainContract.Model {

    @Override
    public Observable<BaseBeanResult> getNews(int defaultCurrent, int pageSize) {
        return Api.getInstance().service.getNews(defaultCurrent,pageSize).map(new Func1<BaseBeanResult, BaseBeanResult>() {
            @Override
            public BaseBeanResult call(BaseBeanResult baseBeanResult) {
                return baseBeanResult;
            }
        }).compose(RxSchedulers.<BaseBeanResult>io_main());
    }
}
